package com.sanabilmed.utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

/**
 * 
 * @author wajdihh
 *
 */
public class Utils{

	/**
	 * Permet de verifier la connexion
	 * @author wajdihh
	 * @param pContext
	 * @return
	 */
	public static boolean isOnline(Context pContext) {
		ConnectivityManager cm = (ConnectivityManager) pContext.getSystemService(Context.CONNECTIVITY_SERVICE);
		NetworkInfo netInfo = cm.getActiveNetworkInfo();
		if (netInfo != null && netInfo.isConnectedOrConnecting()) {
			return true;
		}
		return false;
	}
}
